package com.example.gitapplication.pages;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;

import com.example.gitapplication.R;

public class MainActivity2 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main2);

        //建立页面连接，接收页面
        Intent intent = getIntent();


    }

    public void register(View view) {
        //页面跳转回传参
        Intent intent = new Intent();
        //获取控件
        EditText  usernameExit = findViewById(R.id.exit_placeusername);
        EditText passwordExit = findViewById(R.id.exit_placepassword);
        //获取需要回传的参数
        intent.putExtra("username",usernameExit.getText().toString());
        intent.putExtra("password",passwordExit.getText().toString());
        //将参数回传
        setResult(1001,intent);
        finish();
    }
}